package demo05;

import java.util.ArrayList;
import java.util.Arrays;

/**
 * @author wql
 * @version 1.0
 * @date 2022/11/9 20:08
 */

public class WqlPublic implements PublicHaoInterface{
    private String message;
    private ArrayList<UserInterface> list= new ArrayList<UserInterface >();

    @Override
    public void attention(UserInterface userInterface) {
        list.add(userInterface);
    }

    @Override
    public void NoAttention(UserInterface userInterface) {
        list.remove(userInterface);
    }

    @Override
    public void setMessage(String message) {
        this.message=message;
    }

    @Override
    public void MassMsg() {
        for (UserInterface userInterface:list){
            userInterface.getMessage(message);
        }
    }
}
